/**
 * Copyright By Nanjing Fujitsu Nanda Software Technology Co., Ltd
 * 下午12:42:46
 * WebServiceFault.java
 * 
 */
package com.fujitsu.nanjing.mobile.exception;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 * @author qixb.fnst
 * 
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "http://inter.webService.gardenexposition.yicai.com/", name = "com.yicai.gardenexposition.exception.WebServiceFault", propOrder = {
		"errorCode", "errorStrings"})
public class WebServiceFault {

	private String errorCode;
	private List<String> errorStrings;
	public String getErrorCode() {
		return errorCode;
	}
	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	/**
	 * @param errorCode
	 * @param args
	 */
	public WebServiceFault(String errorCode, List<String> errorString) {
		super();
		this.errorCode = errorCode;
		this.errorStrings = errorString;
	}
	/**
	 * @param errorCode
	 */
	public WebServiceFault(String errorCode) {
		super();
		this.errorCode = errorCode;
		this.errorStrings = new ArrayList<String>();
	}
	/**
	 * 
	 */
	public WebServiceFault() {
		super();
		this.errorCode = "0";
		this.errorStrings = new ArrayList<String>();
	}

	/**
	 * @return the errorString
	 */
	public List<String> getErrorStrings() {
		return errorStrings;
	}
	/**
	 * @param errorString
	 *            the errorString to set
	 */
	public void setErrorStrings(List<String> errorString) {
		this.errorStrings = errorString;
	}
	@Override
	public String toString() {
		return "WebServiceFault [errorCode=" + errorCode + ", errorString="
				+ errorStrings + "]";
	}
	public String[] getArgArray() {
		if (this.errorStrings == null) {
			return null;
		}
		String[] result = new String[this.errorStrings.size()];
		for (int i = 0; i < this.errorStrings.size(); i++) {
			result[i] = this.errorStrings.get(i);
		}
		return result;
	}

}
